// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'


Shader  "Custom/TintedVignette" {

	Properties
	{
_MainTex("Base (RGB)", 2D) = "white" {}
_TintColour("Tint Colour", Color) = (0,0,0,0)
	}



		SubShader
{
Tags { "LIGHTMODE" = "ForwardBase" "QUEUE" = "Transparent+1" "RenderType" = "Opaque" }
Blend Zero SrcColor

  LOD 100
  Pass
  {



  CGPROGRAM
  #pragma vertex vert
  #pragma fragment frag
  #include "UnityCG.cginc"
  //#define Fixed3(value)  fixed3(value, value,value)

  struct VertexInput {
  fixed4 vertex : POSITION;
  fixed2 xlv_TEXCOORD0 : TEXCOORD0;
  //fixed2 xlv_TEXCOORD1 : TEXCOORD1;
  //fixed3 xlv_TEXCOORD2 : TEXCOORD2;
  //fixed3 xlv_TEXCOORD3 : TEXCOORD3;
  //fixed4 tangent : TANGENT;
  fixed3 normal : NORMAL;
  fixed4 xlv_COLOR0 : COLOR;
  //VertexInput
  };


  struct VertexOutput {
  fixed4 pos : SV_POSITION;
  UNITY_FOG_COORDS(1)
  //fixed3 xlv_COLOR0 : COLOR;
  fixed2 xlv_TEXCOORD0 : TEXCOORD0;
  //fixed3 xlv_TEXCOORD1 : TEXCOORD1;
  //fixed3 xlv_TEXCOORD2 : TEXCOORD2;
  //fixed3 xlv_TEXCOORD3 : TEXCOORD3;
  //fixed3 xlv_TEXCOORD4 : TEXCOORD4;
  //VertexOutput
  };


float4 _MainTex_ST;

sampler2D _MainTex;
fixed4 _TintColour;


   VertexOutput vert(VertexInput v)
   {
   VertexOutput o;
   //o.pos = UnityObjectToClipPos (v.vertex);
   //o.xlv_TEXCOORD0 = TRANSFORM_TEX(v.xlv_TEXCOORD0, _MainTex);

 o.pos = UnityObjectToClipPos(v.vertex);
 o.xlv_TEXCOORD0 = ((v.xlv_TEXCOORD0 * _MainTex_ST.xy) + _MainTex_ST.zw);


   UNITY_TRANSFER_FOG(o,o.vertex);

   return o;
   }


   fixed4 frag(VertexOutput i) : SV_Target
   {
	   //fixed4 tmpvar_2 = tex2D(_MainTex, i.uv);

	 half4 main_color_1;
	 main_color_1.w = 0.0;
	 fixed3 tmpvar_2;
	 tmpvar_2 = tex2D(_MainTex, i.xlv_TEXCOORD0).xyz;
	   UNITY_APPLY_FOG(i.fogCoord, tmpvar_2);
	 main_color_1.xyz = tmpvar_2;
	 main_color_1.xyz = (1.0 - (main_color_1 * (1.0 - _TintColour))).xyz;
	 main_color_1.w = 1.0;
	 return main_color_1;

	   }
	   ENDCG
	   }
}
}

